package com.foreknow.view;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;

/**
 * @author xiaoming
 * @version jdk1.8
 * @date 2022/6/28 11:44
 * @function:
 */
public class MainWindow extends JFrame {

    private JPanel contentPane;
    Object columnName[]={"id","name","phone","email","title","content","createdtime"};


    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    MainWindow frame = new MainWindow();

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the frame.
     */
    public MainWindow() {

        setTitle("\u4E3B\u7A97\u53E3");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 450, 300);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        JButton button = new JButton("select");

        JTextField textField = new JTextField();
        textField.setBounds(30, 30, 93, 23);
        contentPane.add(textField);
        textField.setColumns(10);
        button.setBounds(150, 30, 93, 23);
        contentPane.add(button);
        JButton button2 = new JButton("insert");
        button2.setBounds(150, 30, 93, 23);
        contentPane.add(button2);
        JButton button3 = new JButton("update");
        contentPane.add(button3);
        button3.setBounds(150, 30, 93, 23);
        JButton button4 = new JButton("delete");
        button4.setBounds(150, 30, 93, 23);
        contentPane.add(button4);
        Object[][] a = new Object[10][7];
        JTable table=new JTable(a,columnName);
        table.setVisible(true);
        contentPane.add(new JScrollPane(table));
        this.setVisible(true);
    }

}